package org.fastsyncer.framework.connector;

import org.fastsyncer.common.constant.ConnectorConstant;
import org.fastsyncer.common.entity.DataSourceConfig;
import org.fastsyncer.common.entity.DataSourceConnector;
import org.fastsyncer.connector.database.DatabaseConnector;
import org.fastsyncer.connector.framework.ConnectorFactory;

public class Connector {

	private static final Connector instance = new Connector();

	private Connector() {
	}

	public static Connector getInstance() {
		return instance;
	}

	public DataSourceConnector getDataSourceConnector(DataSourceConfig config)
			throws InstantiationException, IllegalAccessException, ClassNotFoundException {
		DatabaseConnector conn = (DatabaseConnector) ConnectorFactory.getInstance(ConnectorConstant.DB_CONNECTOR);
		DataSourceConnector dataSourceConnector = conn.getDataSourceConnector(config);
		return dataSourceConnector;
	}

}
